package edu.online.dao;

import edu.online.dal.UserEntityMapper;
import edu.online.entity.UserEntity;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

public interface UserDao extends UserEntityMapper {

    @Select({
            "select",
            "UserId, UserName, Passwd, Email, Mobile, Role",
            "from tuser"
    })
    @Results({
            @Result(column="UserId", property="userid", jdbcType= JdbcType.CHAR, id=true),
            @Result(column="UserName", property="username", jdbcType=JdbcType.VARCHAR),
            @Result(column="Passwd", property="passwd", jdbcType=JdbcType.VARCHAR),
            @Result(column="Email", property="email", jdbcType=JdbcType.VARCHAR),
            @Result(column="Mobile", property="mobile", jdbcType=JdbcType.CHAR),
            @Result(column="Role", property="role", jdbcType=JdbcType.VARCHAR)
    })
    List<UserEntity> selectALL();
}
